<!-- BEGIN PAGE HEADER-->
<?php $this->load->view('partials/breadcrumb.tpl',Array('_NO_IOSS_NEW'=>1))?>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<script type="text/javascript">
var Polling = {};
Polling.lastId = '<?=$lastItem->id?>';
Polling.ajaxReq = function(){
	$.post("<?=site_url($thisModule.$thisController.'/pollingWithdrawLastId/')?>",{},function(ret){
		var retObj = $.parseJSON(ret);
		if(Polling.lastId == retObj.lastId || retObj.lastId == null){	//请求的最新id与当前的相等，说明没有新记录产生
			console.log('没有新记录产生');
		}else{	//请求的最新id与当前的不同，说明有了新增的记录，将当前lastId更新后，作出提示
			Polling.lastId = retObj.lastId;
			//播放音乐 
			var audio = document.createElement("audio");
			audio.src = "<?=site_url('/static/audio/withdraw_tips.mp3')?>";
			audio.play();
			$('#audio_tip').show();
		}
		
	});
}

$(document).ready(function(){
	$("#reset").click(function(){
		$("select").val('');
		$("input[type='text']").val('');
	});
	setInterval("Polling.ajaxReq()",15000);
	
});
</script>


<div class="row">
	<div class="col-md-12">
		<!-- Begin: life time stats -->
		<div class="portlet">
			<?=form_open('', Array('class'=>'form-inline', 'role'=>'form'))?>
				<?=search_form_input('no',filterValue('no'),'红利单号', 'class="form-control input-medium"');?>
				<?=search_form_input('user_id',filterValue('user_id'),'用户编号', 'class="form-control input-medium"');?>
				<?=search_form_input('account',filterValue('account'),'用户账号', 'class="form-control input-medium"');?>
				<?=search_form_dropdown('withdraw_status',Array(''=>'用户通道状态...')+IOSS_Withdraw::getWithdrawState(),filterValue('withdraw_status'),'', 'class="form-control input-medium"');?>
				<?=search_form_dropdown('transfer_status',Array(''=>'平台转移状态...')+IOSS_Withdraw::getTransferState(),filterValue('transfer_status'),'', 'class="form-control input-medium"');?>
				<button type="button" class="btn default" id="reset">重置条件</button>
				<button type="submit" class="btn green about_search">搜索 <i class="fa fa-search"></i></button>
			<?=form_close()?>
			<div class="portlet-body">
				<div class="row">
					<div class="col-md-12">
						<div class="table-scrollable">
							<table class="table table-hover table-bordered table-striped">
								<thead>
								<tr>
									<th width="10%">红利单号</th>				
									<th width="10%">用户编号</th>
									<th width="10%">用户账号</th>
									<th width="10%">数量</th>
									<th width="15%">用户通道帐户</th>
									<th width="15%">申请时间</th>
									<th width="10%">流水号</th>
									<th width="10%">平台转移</th>
									<th width="10%">红利审核状态</th>
								</tr>
								</thead>
								<tbody>
								<?php  foreach ($list as $node){	?>
									<tr>
										<td>
										<?php if($p->edit){?><a href="<?=site_url($thisModule.$thisController.'/view/'.$node->id)?>"><?php }?>
										<span><?=htmlspecialchars($node->no)?></span>
										<?php if($p->edit){?></a><?php }?>
										</td>
										<td><?=htmlspecialchars($node->user_id)?></td>
										<td><?=htmlspecialchars($node->account)?></td>
										<td><?=htmlspecialchars($node->amount)?></td>
										<td><?=htmlspecialchars($node->card_no)?></td>
										<td><?=date('Y-m-d H:i:s',$node->create_time)?></td>
										<td><?=htmlspecialchars($node->withdraw_transaction)?></td>
										<td><span style="cursor:text" class="<?=element($node->transfer_status, $this->transfer_status_css, '')?>"><?=IOSS_Withdraw::getTransferState($node->transfer_status)?></span></td>
										<td><span style="cursor:text" class="<?=element($node->withdraw_status, $this->pay_status_css, '')?>"><?=IOSS_Withdraw::getWithdrawState($node->withdraw_status)?></span></td>
									</tr>
								<?php }?>
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12 text-right">
						<?=$pagination?>
					</div>
				</div>
			</div>
		</div>
		<!-- End: life time stats -->
	</div>
</div>
<div id="audio_tip" style="display:none;position:fixed;width:300px;height:150px;background:#FF9797;right:0px;bottom:0px;padding:20px;">
	<div style="text-align:center;font-size:18px;line-height:110px;height:110px;">您有新的红利信息 <a style="color:#0000e2;" href="">刷新查看</a></div>
</div>
<!-- END PAGE CONTENT-->
